// pages/mystore/setting/index.js
import { apiUrls, makeRequest } from '../../../utils/api'
Page({

  /**
   * 页面的初始数据
   */
  data: {
    cdnUrl: 'http://static.xunyi.mobi/',
    id:0,
    items:[]
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let that = this;
    that.setData({
      id: options.id
    })
    
  },
  onShow:function(){
    let that = this;
    makeRequest({
      url: apiUrls.getShopDetail(that.data.id),
      method: 'GET',
      data: {
        include: 'category,manager,area'
      },
      success: function (res) {
        wx.setNavigationBarTitle({
          title: res.data.data.name
        })
        that.setData({
          items: res.data.data
        })
      }
    })
  }
})